<?php
require_once('config/include.php');

$form_fields = array(
    'customer_name' => 'required',
    'veggie_slices' => 'whole_number',
    'vegan_slices' => 'whole_number',
    'delivery' => 'required'
);

$data = isset($_POST['data'])? $_POST['data'] : array();

$form = new FormHelper($form_fields, $data);

if(isset($_POST['btn_submit'])){
    
    if($form->validate()){
        $user_dao = new UserDAO();
        $user_dao->create($data);
    }
}
?>
<?php require_once(VIEW_PATH.'register.php');?>